package com.wubo.sec.service;

import java.util.List;

import javax.annotation.security.RolesAllowed;

import com.wubo.sec.filter.IFilterResourceLoader;
import com.wubo.sec.model.UrlResource;

public interface IUrlResourceService extends IFilterResourceLoader {
	
	@RolesAllowed({"ADMIN", "URLRESOURCE_ADD"})
	String create(UrlResource resource);
	
	@RolesAllowed({"ADMIN", "URLRESOURCE_UPDATE"})
	UrlResource update(UrlResource resource);
	
	@RolesAllowed({"ADMIN", "URLRESOURCE_DELETE"})
	void delete(UrlResource resource);
	
	@RolesAllowed({"ADMIN", "URLRESOURCE_DELETE"})
	void delete(String[] codes);
	
	@RolesAllowed({"ADMIN", "URLRESOURCE_READ"})
	List<UrlResource> findAll();
	
	@RolesAllowed({"ADMIN", "URLRESOURCE_READ"})
	List<UrlResource> find(String filter, Object... params);
	
	List<UrlResource> findRunAs(String filter, Object... params);
	
	@RolesAllowed({"ADMIN", "URLRESOURCE_READ"})
	List<UrlResource> getSplitPage(int start, int limit, String filter, Object... params);
	
	@RolesAllowed({"ADMIN", "URLRESOURCE_READ"})
	long getTotal(String filter, Object... params);
	
	UrlResource get(String code);
	
	String getAuthCode(String urlCode);
	
	void relate(String urlCode, String authCode);
}
